package org.lds.hotkey.console.business.appinstance.converter;

import org.lds.hotkey.console.business.appinstance.entity.AppInstance;
import org.lds.hotkey.console.business.appinstance.model.request.AppInstanceBaseListRequest;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;


@Component
public class AppInstanceBaseListRequestToEntityConverter implements Converter<AppInstanceBaseListRequest, AppInstance> {

    @Override
    public AppInstance convert(AppInstanceBaseListRequest source) {
        return AppInstance.builder()
                .id(source.getId())
                .appId(source.getAppId())
                .ip(source.getIp())
                .port(source.getPort())
                .createTime(source.getCreateTime())
                .updateTime(source.getUpdateTime())
                .build();
    }

}


